package day05;
import java.util.Scanner;
public class Addition {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int score = 0;
        for (int a = 1;a<=10;a++){
            int b =(int)(Math.random()*100+1);
            int c =(int)(Math.random()*100+1);
            int result = b+c;
            System.out.println("("+a+")"+b+"+"+c+"=?");
            System.out.println("请输入答案");
            int answer = scan.nextInt();
            if (answer==result){
                System.out.println("答对啦");
                score+=10;
            }else{
                System.out.println("答错了");
            }

        }
        System.out.println("总分为"+score);
    }
}
